package com.xc.request;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author xingchen
 * @description
 * @create 2021/11/28 15:13
 */
public class ConfirmOrderRequest {

    /**
     * 购物车使用的优惠券，集满减优惠券
     * <p>
     * 注意：如果传空或者小于0，则不使用优惠券
     */
    @JsonProperty("coupon_record_id")
    private Long couponRecordId;

    /**
     * 最终购买的商品列表
     * 传递id，购买数量从购物车中读取
     */
    @JsonProperty("product_ids")
    private List<Long> productIdList;

    /**
     * 支付方式
     */
    @JsonProperty("pay_type")
    private String payType;

    /**
     * 端类型
     */
    @JsonProperty("client_type")
    private String clientType;

    /**
     * 收货地址id
     */
    @JsonProperty("address_id")
    private Long addressId;

    /**
     * 总价格，前端传递，后端需要验价
     */
    @JsonProperty("total_amount")
    private BigDecimal totalAmount;

    /**
     * 实际支付的价格，则是减去优惠券后的价格，如果没的话，则是totalAmount一样
     */
    @JsonProperty("real_pay_amount")
    private BigDecimal realPayAmount;

    /**
     * 防重令牌
     */
    @JsonProperty("token")
    private String token;

    public Long getCouponRecordId() {
        return couponRecordId;
    }

    public void setCouponRecordId(Long couponRecordId) {
        this.couponRecordId = couponRecordId;
    }

    public List<Long> getProductIdList() {
        return productIdList;
    }

    public void setProductIdList(List<Long> productIdList) {
        this.productIdList = productIdList;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getRealPayAmount() {
        return realPayAmount;
    }

    public void setRealPayAmount(BigDecimal realPayAmount) {
        this.realPayAmount = realPayAmount;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }


    @Override
    public String toString() {
        return "ConfirmOrderRequest{" +
                "couponRecordId=" + couponRecordId +
                ", productIdList=" + productIdList +
                ", payType='" + payType + '\'' +
                ", clientType='" + clientType + '\'' +
                ", addressId=" + addressId +
                ", totalAmount=" + totalAmount +
                ", realPayAmount=" + realPayAmount +
                '}';
    }
}
